package com.antony.message0928_2;

import java.io.OutputStream;

public class Message {
	private String msg;
	private OutputStream out;
	private String name;
	private boolean isNewPut = true;
	private boolean isNewJoin = true;
	private boolean start = true;
	private Thread ts;

	public Message(OutputStream out, Thread ts) {
		this.out = out;
		this.ts = ts;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean getStart(){
		return start;
	}
	
	public String getName() {
		return name;
	}

	public Message() {
		msg = new String();
	}

	public void addMsg(String msg) {
		this.msg = msg;
		isNewPut = true;
	}

	public String getMsg() {
		return msg;
	}

	public void setIsNewPut(boolean s) {
		isNewPut = s;
	}

	public boolean getIsNewPut() {
		return isNewPut;
	}

	public void setIsNewJoin(boolean j) {
		isNewJoin = j;
	}

	public boolean getIsNewJoin() {
		return isNewJoin;
	}
	
	public void exit(){
		start = false;
		ts.isInterrupted();
	}
}
